{extend name="admin@public:base" /}
{block name="main-row-content"}
<div class="page-header">
	<h1>
		当前操作
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			修改新闻
		</small>
	</h1>
</div><!-- /.page-header -->
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		<form class="form-horizontal ajaxForm4" action="{:url('admin/News/news_trash_runedit')}" method="post" enctype="multipart/form-data">
			<div class="col-md-8">
                 <h4 class="header blue">
                  <i class="ace-icon fa fa-star orange"></i>
                  修改新闻
                 </h4>
                 <input type="hidden" name="id" value="{$news.id}">
                 <div class="form-group">
                   <div class="col-sm-12">
                     <input class="form-control" name="title" value="{$news.title}" placeholder="请输入标题" type="text" required>
                   </div>
                 </div>
                 <div class="form-group">
                   <div class="col-sm-12">
                     <input class="form-control" name="description" value="{$news.description}" placeholder="请输入文章简介" type="text" required>
                   </div>
                 </div>
				<div class="form-group">
                   <div class="col-sm-12"  style="height:400px;">
						<script type="text/javascript" charset="utf-8" src="__PUBLIC__/umeditor/ueditor.config.js"></script>
	    				<script type="text/javascript" charset="utf-8" src="__PUBLIC__/umeditor/ueditor.all.min.js"> </script>
						<script type="text/javascript" charset="utf-8" src="__PUBLIC__/umeditor/lang/zh-cn/zh-cn.js"></script>
						<script id="editor" name="content" type="text/plain" style="width:100%;height:400px;">{$news.content}</script>
						<script type="text/javascript">
	                        var ue = UE.getEditor('editor',{
						 			initialFrameHeight:400,//设置编辑器高度
						 			scaleEnabled:true
						 		});
						</script>
                   </div>
                 </div>                 
			</div>
			<div class="col-md-4">
                 <h4 class="header blue">
                  <i class="ace-icon fa fa-star orange"></i>
                  拓展面板
                 </h4>
                <div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">发布时间：</label>
					<div class="col-sm-8">
						<input class="layui-input" name="addtime" id="test5" placeholder="yyyy-MM-dd HH:mm:ss" value="{$news.addtime|date='Y-m-d H:i',###}" type="text" required>
					</div>
				</div>
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 文章属性：  </label>
					<div class="checkbox">
							<label id="news_flag_c">
								<input class="ace ace-checkbox-2" name="type[]" value="r" {if condition="strstr($news['type'],'r') eq true"}checked{/if} type="checkbox">
								<span class="lbl"> 热门</span>
							</label>					        					
							<label id="news_flag_c">
								<input class="ace ace-checkbox-2" name="type[]" value="t"  {if condition="strstr($news['type'],'t') eq true"}checked{/if} type="checkbox">
								<span class="lbl"> 推荐</span>
							</label>
							<label id="news_flag_p">
								<input class="ace ace-checkbox-2" name="type[]" value="z"  {if condition="strstr($news['type'],'z') eq true"}checked{/if} type="checkbox">
								<span class="lbl"> 置顶</span>
							</label>
							<label id="news_flag_d">
								<input class="ace ace-checkbox-2" name="type[]" value="y"  {if condition="strstr($news['type'],'y') eq true"}checked{/if} type="checkbox">
								<span class="lbl"> 原创</span>
							</label>
					</div>
				</div>
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-2">所属分类：</label>
					<div class="col-sm-8">
					   <select name="cid" class="col-sm-8" required >
	                        <option value="0">--请选择--</option>
	                        {foreach name="news_cate" item="vo"}
	                        <option value="{$vo.id}" {if condition="$news.cid eq $vo.id"}selected{/if}>{$vo.name}</option>
	                        {/foreach}
	                    </select>
					</div>
				</div>
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-2">文章来源：</label>
					<div class="col-sm-8">
						<input type="text" name="source" id="source" value="{$news.source}" class="col-sm-8" />						
					</div>
					<div class="col-sm-8 col-sm-offset-3" style="margin-top:5px">
							<label class="input_last">
								{foreach name="news_source" item="vo" length="4"}
									<a class="btn btn-minier btn-yellow" href="javascript:;" onclick="$('#source').val('{$vo.name}')" >{$vo.name}</a>&nbsp;
								{/foreach}
							</label>                      
					</div>			
				</div>
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">关键字：</label>
					<div class="col-sm-8">
						<input type="text"  name="keywords" value="{$news.keywords}" placeholder="文章关键字,多个以逗号隔开" class="col-sm-12"/>
					</div>
				</div>
	            <div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">排序：</label>
					<div class="col-sm-8">
						<input type="text"  name="sort" value="{$news.sort}" class="col-sm-12" required/>
					</div>
				</div>
	            <div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">阅读量：</label>
					<div class="col-sm-8">
						<input type="text"  name="readc" value="{$news.readc}" class="col-sm-12" required/>
					</div>
				</div>
	            <div class="space-4"></div>	            
	             <div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">封面图：</label>
					<div class="col-sm-8">
					    <div class="col-sm-8">
							<a href="javascript:;" class="file">
								<input name="img" id="img_upload" type="file">
								<i class="fa fa-cloud-upload "></i>上传封面图
							</a>
						</div>
						<div class="file_img_show col-sm-12">
						    <div class="img col-xs-2" id="show_upload_img">
						      <i class="ace-icon fa fa-times red remove_upload_img"></i>
						      <img src="{$news.img|get_img}" alt="">
						    </div>
						</div>
					</div>
				</div>
			</div>
			<div class="clearfix">
				<div class="col-md-offset-3 col-md-9 ">
					<button class="btn btn-info btn-sm btn-radius" type="submit">
						<i class="ace-icon fa fa-check bigger-110"></i>
						保存
					</button>

					&nbsp; &nbsp; &nbsp;
					<button class="btn btn-success btn-sm btn-radius" type="button" onclick="preview()">
						<i class="ace-icon fa 	fa-eye bigger-110"></i>
						预览
					</button>            
					&nbsp; &nbsp; &nbsp;					
					<button class="btn btn-success btn-sm btn-radius" type="reset">
						<i class="ace-icon fa fa-undo bigger-110"></i>
						重置
					</button>
				</div>
			</div>

			
		</form>
	</div><!-- /.col -->
</div><!-- /.row -->
{/block}
{block name="script"}
<script src="__STATIC__/layui/layui.all.js"></script>
<!-- <link href="__STATIC__/layui/css/layui.css" rel="stylesheet"/> -->
<script type="text/javascript">
	layui.use('laydate', function(){
		  var laydate = layui.laydate;
		 //时间选择器
		  laydate.render({
		    elem: '#test5'
		    ,type: 'datetime'
		  });
	})
</script>
{/block}